package ZY11_05;
import java.util.Scanner;
public class Test1 {
        public static void main(String[] args) {
            Scanner input = new Scanner(System.in);
            Company1 company = new Company1();
            int choice = 0;
            while (true) {
                System.out.println("1:添加，2：显示 3:开除 4:涨薪 5:显示薪水最高的员工信息 6:判断是否最高龄并涨薪");
                choice = input.nextInt();
                if (choice == 1) {
                    Staff staff = new Staff();
                    System.out.println("请输入要添加的员工工号");
                    staff.setJobNumber(input.next());
                    System.out.println("请输入要添加的员工姓名");
                    staff.setName(input.next());
                    System.out.println("请输入要添加的员工年龄");
                    staff.setAge(input.nextInt());
                    System.out.println("请输入要添加的员工性别");
                    staff.setGender(input.next());
                    System.out.println("请输入要添加的员工职务");
                    staff.setPost(input.next());
                    System.out.println("请输入要添加的员工薪水");
                    staff.setSalary(input.nextDouble());
                    String result = company.addStaff(staff)?"添加成功":"添加失败";
                    System.out.println(result);
                }else if(choice == 2){
                    company.showList();
                }else if (choice ==3){
                    System.out.println("请输入要开除员工的id:");
                    String result = company.delStaff(input.next())?"删除成功":"删除失败";
                    System.out.println(result);
                }else if (choice ==6){
                    System.out.println("请输入要判断的员工id");
                    String result = company.raise(input.next())?"成功":"失败";
                    System.out.println(result);
                }else if (choice ==5){
                    System.out.println("最高薪水员工的信息如下");
                    Staff staff = company.showMaxStaff();
                    System.out.println("员工姓名\t员工年龄\t员工性别\t员工职务\t员工薪水\t员工工号\t");
                    System.out.println(staff.getName()+"\t\t"+staff.getAge()+"\t\t"+staff.getGender()+"\t\t"+staff.getPost()+"\t\t"+staff.getSalary()+"\t\t"+staff.getJobNumber());
                } else {
                    break;
                }
            }
            System.out.println("结束了。。。");
        }
    }
